<?php
session_start();
if (isset($_SESSION["username"])) {
    ?>  
<html>
        <?php
        include 'includes/header.inc.php';
        ?>
    <body>
        <!-- Datenbank -->
            <?php include 'includes/db_connect.inc.php'; ?>
        <div class="site-wrapper">
            <div class="site-wrapper-inner">
                <div class="cover-container">
                    <div class="inner cover">
                        <table class="table">
                                <?php
                                $sql = "SELECT * FROM quizUser";
                                $Erg_Tabelle = mysql_query($sql);
                                
                                while($zeile = mysql_fetch_array($Erg_Tabelle, MYSQL_ASSOC))
                                {
                                    echo "<tr>";
                                    echo "<td>". $zeile['ID'] . "</td>";
                                    echo "<td>". $zeile['Name'] . "</td>";
                                    echo "<td>". $zeile['Vorname'] . "</td>";
                                    echo "<td>". $zeile['Email'] . "</td>";
                                    echo "<td>". $zeile['Punkte'] . "</td>";
                                    echo "<td>". $zeile['LoginCounter'] . "</td>";
                                    echo "</tr>"; 
                                }?>
                        </table>
                    </div>
                    <div class="mastfoot">
                        <div class="inner">
                            <p>a FSX-Projekt production powered by Lex & Nyhsel</p>
                            <br> <a href="logout.php">Logout</a><br>
                        </div>
                    </div> 
                </div> 
            </div> 
        </div> 
    </body>

</html>
    <?php
} else {
    ?>
<html>
    <!-- HEADER -->
        <?php
        include 'includes/header.inc.php';
        ?>
    <head>
        <!--Falls eingelogt= weiterleiten auf Quiz -->
            <?php
            include 'includes/session_true_link.php';
            ?>
    </head>

    <body>
        <!-- CONTENT-->
        <div class="site-wrapper">
            <div class="site-wrapper-inner">
                <div class="cover-container">
                    <div class="inner cover">
                        <h1 class="cover-heading">Bitte loggen sie sich <a href="index.php">hier</a> ein.</h1>

                    </div>
                    <div class="mastfoot">
                        <div class="inner">
                            <p>a FSX-Projekt production powered by Lex & Nyhsel</p>
                        </div>
                    </div>     
                </div>
            </div>
        </div>
            <?php
            include 'includes/footer.inc.php';
            ?>
    </body>   
</html>
    <?php
}
?>

<!-- 

<table class="table">
  ...
</table>

-->